package com.niit;

import com.niit.entity.Category;
import com.niit.mapper.CategoryMapper;
import com.niit.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

public class TestSelectKeys {
    public static void main(String[] args) {

        SqlSession sqlSession = MybatisUtil.getSqlSession();
        CategoryMapper categoryMapper = sqlSession.getMapper(CategoryMapper.class);

        Category category = new Category();
        category.setCname("jv1-分类-sk");
        category.setCdescription("jv1-分类描述-sk");

        categoryMapper.addCategoryUserDefindedKeys(category);
        sqlSession.commit();// 提交事务
        System.out.println("添加成功!");

    }
}
